package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;

/**
 * Represents an equilateral triangle used in Task 1.
 * <p>
 * This class draws a triangle with equal sides and sharp angles.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public class JfTriangle extends JfShape2D {

    /**
     * Constructs a new equilateral triangle with the specified size.
     *
     * @param size the base width of the triangle
     */
    public JfTriangle(double size) {
        this.size = size;
        shape = new Polygon(
                0, size,
                size, size,
                size / 2, size - size / 2 * Math.sqrt(3)
        );
        initBaseParams(Color.CYAN);
    }
}
